/***********************************************************************************
 * X2Engine Open Source Edition is a customer relationship management program developed by
 * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
 * California 94061, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2 Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2 Engine".
 **********************************************************************************/




@import "standards";
@import "../mobileColors";

$tabHeight: $itemHeight / 2;

@mixin dialog-box-shadow {
    @include box-shadow(0 3px 11px 0px gray);
}

@mixin btn-states($opacity: 0.1) {
    &:hover { 
        background: rgba(0,0,0, $opacity);
    }
    &:active { 
        background: rgba(0,0,0, $opacity);
        //background: rgba(0,0,0,0.15);
    }
}

@mixin popup-menu {
    ul {
        background: $menuBackgroundColor;
        color: $menuText;
        .ui-popup {
            border: none;
        }
        a {
            color: $menuText;
            border: none;
            text-decoration: none;
        }
        box-shadow: 0px 3px 11px #2D2D2D;
    }
}

@mixin no-data-message {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    text-align: center;
    height: 16px;
    margin: auto;
}

/*
header
*/

@mixin header-text-button {
    color: $headerText;
    font-size: $headerTextSize;
    padding: 0 10px;
    cursor: pointer;
    &.disabled {
        color: $headerTextSecondary;
    }
}

/*
list view
*/

@mixin list-item {
    height: $itemHeight;
    border-bottom: 1px solid $itemBorderColor;
    padding: 10px;
    color: $text;
    a {
        color: $linkColor;
    }
    background-color: $backgroundColor;
}

@mixin list-item-label {
    font-size: $labelFontSize;
    color: gray;
    margin-bottom: 5px;
}

@mixin rich-record-index {
    .record-list-item {
        background: white;
        padding: 15px 0; 
        cursor: default;
        overflow-y: hidden;
        height: auto;
        margin-bottom: 10px;
        border-top: 1px solid $lightGray;
        @include box-shadow(0px 1px 2px lighten($borderColor, 3%));
    }
}
/*
@mixin photo-attachment {
    .photo-attachment-container {
        img {
            max-width: 100%;
            @media (min-width: 500px) {
                max-width: 500px;
            }
        }
    }
}

@mixin audio-attachment {
    .audio-attachment-container {
        audio {
            max-width: 100%;
            @media (min-width: 500px) {
                max-width: 500px;
            }
        }
    }
}

@mixin video-attachment {
    .video-attachment-container {
        video {
            max-width: 100%;
            @media (min-width: 500px) {
                max-width: 500px;
            }
        }
    }
}
*/
/*
panel
*/

/*
login
*/

@mixin login-button {
    padding: 0;
    height: 48px;
    line-height: 46px;
    margin: 0;
    margin-top: 0;
    font-size: 18px;
    input {
        font-size: 18px;
        padding: 10px 10px;
    }
}

/*
forms
*/

@mixin text-input {
    .ui-input-text {
        border: 1px solid $lightGray;   
        border-radius: 3px;
        height: $inputHeight;
        input {
            height: $inputHeight;
            padding-top: 0;
            padding-bottom: 0;
        }
        @include box-shadow(inset 0px 1px 3px $itemBorderColor);
        .x2-autocomplete-results-container {
            position: absolute;
            left: 0;
            right: 0;
            top: 98px;
            width: 100%;
            background: white;
            z-index: 1000;
            overflow-y: scroll;
        }
        &.error {
            border-color: $inputErrorBorder;
            @include box-shadow(inset 0px 1px 3px lighten($inputErrorBorder,15%));
            background: lighten($inputErrorBorder, 30%);
            input.error {
            }
        }
    }
}

/*
users
*/

@mixin avatar($dimension:45px) {
    .avatar {
        .avatar-image {
            border: 1px solid $borderColor;
            border-radius: 50%;
            width: $dimension;
            height: $dimension;
            line-height: $dimension;
            text-align: center;
            overflow: hidden;
            &.default-avatar {
                background: $lightGray;
                color: darken($lightGray, 17%);
            }
        }
    }
}
